import Vue from 'vue'
import VueOnkeypress from '@/utils/onkeypress/index.js'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
//import locale from 'element-ui/lib/locale/lang/en'
import '@/styles/index.scss' // global css
import App from './App'
import router from './router'
import store from './store'
import '@/icons' // icon
import '@/permission' // permission control
import './components/searchHeader'//一些公共的搜索头
import './components/countDown'//倒计时
import '@/components/purchase'//采购相关公共组件
import VuePreview from 'vue-preview'//引入veu-preview预览
//使用vue-preview
Vue.use(VuePreview)
// import VueLazyLoad from 'vue-lazyload'//图片懒加载printer
// 省市区
import region from '@/components/region/region'
Vue.component('dj-region', region)

//自定义搜索按钮
import djButton from '@/components/Button/dj-button'
Vue.component('dj-button',djButton)

import Print from './utils/print'
Vue.use(Print)

//v-viewer 图片预览
import 'viewerjs/dist/viewer.css'
import Viewer from 'v-viewer'
Vue.use(Viewer,{
    defaultOptions: { inline: false, button: true, navbar: true, title: true, toolbar: true, tooltip: true, movable: true, zoomable: true, rotatable: true, scalable: true, transition: true, fullscreen: true, keyboard: true, url: 'data-source' }
});
Vue.use(ElementUI);

Vue.config.productionTip = false;

//全局方法Vue.filter()统一注册自定义过滤器
import filters from "./common/filters/filter"
Object.keys(filters).forEach(key => {//返回filters对象中属性名组成的数组
    Vue.filter(key, filters[key])
})
//输入整字指令
Vue.directive('VueOnkeypress', VueOnkeypress);

new Vue({
    store,
    router,
    render: h => h(App),
}).$mount('#app');